#"""
#Routes and views for the flask application.
#"""


#from datetime import datetime
#from flask import render_template
#from RPIControl import *
#import json
#from Lib.SerialPort import *
#import time
#from threading import Lock
#sp = SerialPort('/dev/serial_1',9600)

#thread = None
#thread_lock = Lock()

#def background_thread():
#    while True:
#        sp.Write("#~000~qst~handshake~@".encode())
#        encodestr = bytes.decode(sp.Read())
#        temp1 = ''
#        try:
#            temp1 = ((encodestr.split(','))[0]).split(':')[1]
#        except :
#            pass
#        socketio.emit('server_response', temp1,namespace='/test')
#        time.sleep(1)

#@app.route('/')
#@app.route('/home')
#def home():
#    """Renders the home page."""
#    return "fdfdfdf"

#@app.route('/contact')
#def contact():
#    """Renders the contact page."""
#    return render_template('contact.html',
#        title='Contact',
#        year=datetime.now().year,
#        message='Your contact page.')

#@app.route('/about')
#def about():
#    return render_template('about.html',
#        title='Contact',
#        year=datetime.now().year,
#        message='Your contact page.')

#@socketio.on('connect', namespace='/test')
#def sockettest():
#    global thread
#    with thread_lock:
#        if thread is None:
#            thread = socketio.start_background_task(target=background_thread)


#from datetime import datetime
#from RPIControl import *
#import json
#from Lib.SerialPort import *
#from Lib.RelayControl import *
#from Lib.Utils import *
#from SqlData.DataEntity import *
#from SqlData.Business import *
#import time
#from threading import Lock
#import threading
#import uuid
#import os
#from concurrent.futures import ThreadPoolExecutor

#c = 0
#thread = None
#thread_lock = Lock()


#@app.route('/set')
#def set():
#    #executor.submit(add)
#    return '1'

#@app.route('/get')
#def get():
#    return str(c)

#def add():
#    global c
#    while True:
#        print(str(c))
#        time.sleep(1)
#        c = c + 1


#p = threading.Thread(target=add)
#p.start()
    

